<template>
    <p>检查页面中 fixed 的按钮，该按钮 5 秒内消失</p>
</template>

<script setup lang="ts">
import { Component } from 'vue';
import { useRenderToBody } from 'useless/core'

const Foo: Component = {
    template:
    `
        <el-button type="primary" style="position: fixed; top: 40%; left: 40%">一个位于 body 上的按钮，5秒后消失</el-button>
    `
}

const { render, unRender } = useRenderToBody()
const container1 = render(Foo)

setTimeout(() => {
    const v =  unRender(container1)
    console.log(v)
}, 5000);
</script>